package com.econ.powercloud.ems.common.enums;

/**
 *
 * @author hcx
 * @since 2023/6/28 14:26
 **/
public enum EmsYcYxStrategyEnum implements EnumMethod {

    YX_ALARM_FAULT_STRATEGY(1,"yx故障告警操作策略");

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }


    EmsYcYxStrategyEnum(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static EmsYcYxStrategyEnum fromCode(int code){
        for(EmsYcYxStrategyEnum type: EmsYcYxStrategyEnum.values()){
            if(type.getCode() == code){
                return type;
            }
        }
        return null;
    }

    public static String getDescFromCode(int code){
        for(EmsYcYxStrategyEnum type: EmsYcYxStrategyEnum.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }
}
